package org.jeecg.modules.goldentry.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.goldentry.entity.GoldEntry;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

/**
 * @Description:  金出入库
 * @Author: jerryzhu
 * @Date:   2021-11-15
 * @Version: V1.0
 */
public interface GoldEntryMapper extends BaseMapper<GoldEntry> {
	
	/**查询金出入库数据明细分页*/
	IPage<GoldEntry> selectGoldEntryPage(Page<GoldEntry> page, @Param(Constants.WRAPPER) Wrapper<GoldEntry> queryWrapper);

	/**查询仓库库存数据列表，不分页*/
	List<GoldEntry> getGoldEntryStorageSummaryList(@Param("storageId") String storageId);
	
	/**查询员工库存数据列表，不分页*/
	List<GoldEntry> getGoldEntryPersonSummaryList(@Param("userName") String userName);
	
	/**根据成色ID获取折足率*/
	@Select("select gold_content from gold_karat where id = #{karat}")
	String getGoldContentByKaratId(@Param("karat") String karat);

	/**根据ID获取仓库名字*/
	@Select("select name from gold_storage where id = #{id}")
	String getStorageName(@Param("id") String id);
}
